﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SM.Common.VPowers.IIs
{
    public class IIsVirtualDirInfo
    {
        bool read;
        bool execute;
        bool script;
        bool ssl;
        bool write;
        bool authbasic;
        bool authntlm;
        bool indexed;
        bool endirbrow;
        bool endefaultdoc;
        string name;
        string path;
        int flag;
        string defaultdoc;
        bool anonymous;
        int iisVersion;

        public IIsVirtualDirInfo()
        {
        }

        public int Flag
        {
            get { return flag; }
            set { flag = value; }
        }

        public bool AccessRead
        {
            get { return read; }
            set { read = value; }
        }

        public bool AccessWrite
        {
            get { return write; }
            set { write = value; }
        }

        public bool AccessExecute
        {
            get { return execute; }
            set { execute = value; }
        }

        public bool AuthAnonymous
        {
            get { return anonymous; }
            set { anonymous = value; }
        }

        public bool AccessSSL
        {
            get { return ssl; }
            set { ssl = value; }
        }

        public bool AccessScript
        {
            get { return script; }
            set { script = value; }
        }

        public bool AuthBasic
        {
            get { return authbasic; }
            set { authbasic = value; }
        }

        public bool AuthNTLM
        {
            get { return authntlm; }
            set { authntlm = value; }
        }

        public bool ContentIndexed
        {
            get { return indexed; }
            set { indexed = value; }
        }

        public bool EnableDirBrowsing
        {
            get { return endirbrow; }
            set { endirbrow = value; }
        }

        public bool EnableDefaultDoc
        {
            get { return endefaultdoc; }
            set { endefaultdoc = value; }
        }

        public string Path
        {
            get { return path; }
            set { path = value; }
        }

        public string DefaultDoc
        {
            get { return defaultdoc; }
            set { defaultdoc = value; }
        }

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public int IIsVersion
        {
            get { return iisVersion; }
            set { iisVersion = value; }
        }

        public string AppPoolID
        {
            get
            {
                if (iisVersion >= 7)
                {
                    return "Classic .NET AppPool";
                }
                else
                {
                    return "DefaultAppPool";
                }
            }
        }
    }

}
